package databaseVersionControl.domain.dialect;

import java.util.HashMap;
import java.util.Map;

import databaseVersionControl.domain.db.DataType;

public abstract class Dialect {
	
	private Map<Dialect, Map<DataType, String>> mapType = new HashMap<Dialect, Map<DataType, String>>();
	
	public Dialect() {
		setup();
	}
	
	protected abstract void setup();

	protected void registerColumnType(DataType type, String value) {
		if (mapType.get(this) == null) mapType.put(this, new HashMap<DataType, String>());
		mapType.get(this).put(type, value);
	}
	
	public String getType(DataType type) {
		return mapType.get(this).get(type);
	}
	
	public abstract String getNextSequenceValue(String sequenceName);

	public abstract String checkExistTable(String tableName);

	public abstract String checkExistSequence(String sequenceName);

}